#include <string.h>
struct stu
{
	char name[20];
	int age;
};
 
int com_stu_name(const void* p1, const void* p2)
{
	return  strcmp(((struct stu*)p1)->name , ((struct stu*)p2)->name);
}
 
int main()
{
	struct stu sl[] = { {"zhangshan",19}, {"wangwu", 52} ,{"lishi",22} };
	int num = sizeof(sl) / sizeof(sl[0]);
 
	qsort(sl, num, sizeof(sl[0]), com_stu_name);
 
	return 0;
}